package com.greatwall.hip.cms.constant;

/**
 * @author ljl
 * @date 2021/7/7 20:51
 **/
public enum AlertLevelEnum {

    NORMAL(0, "正常"),

    LOW(1, "低风险"),

    MIDDLE(2, "中风险"),

    HIGH(3, "高风险");

    private int level;
    private String desc;

    AlertLevelEnum(int level, String desc) {
        this.level = level;
        this.desc = desc;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public static AlertLevelEnum getByLevel(int level) {
        for (AlertLevelEnum value : values()) {
            if (value.getLevel() == level) {
                return value;
            }
        }
        return NORMAL;
    }

}
